#include "MainForm.h"
#include <QtWidgets/QApplication>
#include <osgViewer\Viewer>
#include "ViewerWidget.h"
#include <QWidget>

int main(int argc, char *argv[])
{
//	osg::ArgumentParser arguments(&argc, argv);
//
//#if QT_VERSION >= 0x050000
//	// Qt5 is currently crashing and reporting "Cannot make QOpenGLContext current in a different thread" when the viewer is run multi-threaded, this is regression from Qt4
//	osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::SingleThreaded;
//#else
//	osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
//#endif
//
//	while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded;
//	while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
//	while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext;
//	while (arguments.read("--CullThreadPerCameraDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullThreadPerCameraDrawThreadPerContext;
//
//#if QT_VERSION >= 0x040800
//	// Required for multithreaded QGLWidget on Linux/X11, see http://blog.qt.io/blog/2011/06/03/threaded-opengl-in-4-8/
//	if (threadingModel != osgViewer::ViewerBase::SingleThreaded)
//		QApplication::setAttribute(Qt::AA_X11InitThreads);
//#endif

	QApplication a(argc, argv);
	MainForm w;
	w.show();
	return a.exec();
}
